From 788407dc248838f22268dee431702eff7dcf5937 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 7 May 2026 20:20:24 +0200 Subject: [PATCH] extensionSystem: Split out the actual extension disabling We will need it in an upcoming commit, and let's try to share code, even if it's not much Part-of: (cherry picked from commit 3a4bb929e34d6fbe36f84a335180d063cdf7d413) --- js/ui/extensionSystem.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index fcff08eb4..9a34a9cbf 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -180,6 +180,14 @@ export class ExtensionManager extends Signals.EventEmitter { return false; } + _callExtensionDisable(extension) { + try { + extension.stateObj.disable(); + } catch (e) { + this.logExtensionError(extension.uuid, e); + } + } + async _callExtensionDisableWithRebase(uuid) { const extension = this.lookup(uuid); if (!extension) @@ -204,20 +212,11 @@ export class ExtensionManager extends Signals.EventEmitter { for (let i = 0; i < orderReversed.length; i++) { const otherUuid = orderReversed[i]; - try { - console.debug(`Temporarily disable extension ${otherUuid}`); - this.lookup(otherUuid).stateObj.disable(); - } catch (e) { - this.logExtensionError(otherUuid, e); - } - } - - try { - extension.stateObj.disable(); - } catch (e) { - this.logExtensionError(uuid, e); + console.debug(`Temporarily disable extension ${otherUuid}`); + this._callExtensionDisable(this.lookup(otherUuid)); } + this._callExtensionDisable(extension); this._unloadExtensionStylesheet(extension); for (let i = 0; i < order.length; i++) { -- 2.39.5